﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.CApExportToRTROrigin
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.Generic;


namespace DnProcessSimulateCommands.ExportToRTR{

public class CApExportToRTROrigin : ICApExportToRTRWriteable
{
  private double[] m_xyz;
  private double[] m_rpy;

  public CApExportToRTROrigin(double[] xyz, double[] rpy)
  {
    this.m_xyz = xyz;
    this.m_rpy = rpy;
  }

  public void Write(CApExportToRTRXmlWriter writer)
  {
    writer.WriteStartElement("origin");
    this.WriteAttribute(writer, "xyz", this.m_xyz);
    this.WriteAttribute(writer, "rpy", this.m_rpy);
    writer.WriteEndElement();
  }

  private void WriteAttribute(CApExportToRTRXmlWriter writer, string name, double[] arr)
  {
    if (arr == null)
      return;
    writer.WriteAttributeString(name, ((IEnumerable<double>) arr).DoubleArrayToString());
  }
}
